import React from 'react'
import { browserHistory ,Link} from 'react-router'
import './BankCard.less'
import Enume from 'containers/Wallet/enume'
/**
 * 类别：组件
 * 功能：银行卡
 */
class BankCardSheet extends React.Component {
    constructor(props, context) {
        super(props, context);

    }
    componentWillReceiveProps (nextProps) {
      // this.setState({
      //   bankEnume: nextProps.walletinfo.bankEnume
      // });
    }
    componentWillMount () { 
        if (this.props.choosed) {
            this.scrollTop = 20
        }
    }
    handleClick (){
        if (this.props.handleClick) {
            this.props.handleClick(this.props.card);
        }
    }
    render() {
        return (
        	<div className="bankCard" onClick={this.handleClick.bind(this)} style={{borderBottom:'1px solid #eeeeee',lineHeight:'0.2rem'}}>
                <div className="inline-block">
                {
                    this.props.choosed === true ?  <div><i className="role-color iconfont icon-checkcircle"/></div> : 
                    <div className="lightgray"><i className=" iconfont icon-circular"/></div>
                }
                </div>
                <div className="iconItem inline-block" >
                    <div className="smallIcon">
                        <img src={this.props.card.bankIconUrl} alt="" />
                    </div>
                </div>
                <div className=" inline-block">
                    <div className="bank">{this.props.card.bankName}</div>
                </div>
        	</div>
        )
    }
}


export default BankCardSheet
